﻿@{
    ViewBag.Title = "信开数码软件审批系统1.0";
}
@section style
{
<style type="text/css">
    * { margin: 0; padding: 0; }
    html,body{ height:100%; width:100%; overflow: hidden; }
    .l-case-title {font-weight: bold;margin-top: 20px;margin-bottom: 20px;}
    .l-taskbar-task-icon {top: 3px;left: 6px;background-image: none;}
    .l-taskbar-task-content {margin-left: 30px;}
    .l-taskbar-task-icon img {width: 22px;height: 22px;}

    #winlinks
    {
        position: absolute;
        left: 20px;
        top: 20px;
        width: 100%;
    }
    #winlinks ul { position: relative; }
    #winlinks li
    {
        width: 70px;
        cursor: pointer;
        height: 80px;
        position: absolute;
        z-index: 101;
        list-style: none;
        text-align: center;
    }
    #winlinks li img { width: 36px; height: 36px; }
    #winlinks li span
    {
        display: block;
        font-size: 12px;
        margin-top: 1px;
        color: White;
        line-height: 18px;
        text-align: center;
    }
    #winlinks li.l-over div.bg { display: block; }
    #winlinks li div.bg
    {
        display: none;
        position: absolute;
        top: -2px;
        left: -2px;
        z-index: -999;
        width: 75px;
        height: 64px;
        background: #0094ff;
        opacity: 0.3;
        filter: alpha(opacity=10);
    }
</style>
}
<div id="topmenu" class="l-topmenu" style="height:65px;background:#fff;">
    <div style="padding-left:200px;line-height:60px;background:url('/Content/images/xklogo_cn.jpg') no-repeat 10px 5px;">&nbsp;</div>
    <div class="l-topmenu-welcome">
        @{
            var user = @CommonLibrary.UserAction.GetCurrentUser();
            <span>您好, @user.LoginName</span>
            if(user.IsAdmin || user.IsSupperAdmin)
            {
            <span class="space">|</span>
            <a href="/Admin" class="l-link2">后台管理</a>
            <span class="space">|</span>
            <a href="/WF" class="l-link2">流程管理</a> 
            }
            <span class="space">|</span>
            <a href="/Account/ChangePassword" class="l-link2">修改密码</a>
            <span class="space">|</span>
            <a href="/Account/Logout" class="l-link2">退出</a>
        }
    </div> 
</div>
<div id="layout"> 
    <div position="center" style="background: url('/Content/images/ppt1.jpg') no-repeat center rgb(3,81,147);"> 
        <div id="winlinks">
            <ul></ul>
        </div>
    </div>
</div>
<div style="height:32px; line-height:32px; text-align:center;">
版权所有©大连信开数码软件有限公司 2013-2014 
</div>

<script type="text/javascript">
    var LINKWIDTH = 90, LINKHEIGHT = 90, TASKBARHEIGHT = 43;
    var winlinksul =  $("#winlinks ul");
    function f_open(url, title, icon) {
        var win = $.ligerDialog.open(
        {
            width: 800, height: 480, url: url,
            showMax: true, showToggle: true, showMin: true,
            isResize: true, modal: false, title: title,
            isHidden: false, slide: false, allowClose: true,
            buttons: [{
                text: '确定', onclick: function (item, Dialog, index) {
                    win.frame.src = null;
                    win.close();
                }
            }]
        });
        var task = jQuery.ligerui.win.tasks[win.id];
        if (task) {
            $(".l-taskbar-task-icon:first", task).html('<img src="' + icon + '" />');
        }
        win.max();
        return win;
    }

    var links = [
            { icon: '/Content/images/Book_Journal_48x48.png', title: '提交申请', url: '/Item' },
            { icon: '/Content/images/Book_Green_48x48.png', title: '我的审批', url: '/Work' },
            { icon: '/Content/images/AutoList.png', title: '我的申请记录', url: '/Item/Histories' },
            { icon: '/Content/images/AutoList.png', title: '我的审批纪录', url: '/Work/Histories' },
            { icon: '/Content/icons/mailbox.gif', title: '其他审批信息', url: '/Reception' }
        ];
             
    function onResize() {
        var linksHeight = $(window).height() - TASKBARHEIGHT;
        var winlinks = $("#winlinks");
        winlinks.height(linksHeight);
        var colMaxNumber = parseInt(linksHeight / LINKHEIGHT);//一列最多显示几个快捷方式
        for (var i = 0, l = links.length; i < l; i++) {
            var link = links[i];
            var jlink = $("li[linkindex=" + i + "]", winlinks);
            var top = (i % colMaxNumber) * LINKHEIGHT, left = parseInt(i / colMaxNumber) * LINKWIDTH;
            if (isNaN(top) || isNaN(left)) continue;
            jlink.css({ top: top, left: left });
        }

    }
    function linksInit() {
        for (var i = 0, l = links.length; i < l; i++) {
            var link = links[i];
            var jlink;
            var jlink = $("<li></li>");
            jlink.attr("linkindex", i);
            jlink.append("<img src='" + link.icon + "' />");
            jlink.append("<span>" + link.title + "</span>");
            jlink.append("<div class='bg'></div>");
            jlink.hover(function () {
                $(this).addClass("l-over");
            }, function () {
                $(this).removeClass("l-over");
            }).click(function () {
                var linkindex = $(this).attr("linkindex");
                var link = links[linkindex];
                f_open(link.url, link.title, link.icon);
            });
            jlink.appendTo(winlinksul);
        }

    }

    $(window).resize(onResize);
    $.ligerui.win.removeTaskbar = function () { }; //不允许移除
    $.ligerui.win.createTaskbar(); //页面加载时创建任务栏

    linksInit();
    onResize();
    $("#layout").ligerLayout({ heightDiff: -65 });
</script>
